﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LandandSurvey
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load( object sender, EventArgs e )
        {
            if (!IsPostBack)
            {
                if (Session["user.loggedin"] != null && Session["user.loggedin"].ToString() == "true")
                {
                    loginlink.InnerText = "Click to Logout";
                    loginlink.HRef = "Logout.aspx";
                }
                else
                {
                    loginlink.InnerText = "Click to Login";
                }
                if (Request.Url.ToString().Contains("About.aspx"))
                {
                    liabout.Attributes.Add("class", "current");
                }
                else if (Request.Url.ToString().Contains("Default.aspx"))
                {
                    lihome.Attributes.Add("class", "current");
                }
                else if (Request.Url.ToString().Contains("FileUpload.aspx") ||
                    Request.Url.ToString().Contains("ErrorPermission.aspx") ||
                    Request.Url.ToString().Contains("SuccessETL.aspx") ||
                    Request.Url.ToString().Contains("SuccessFileUpload.aspx")
                    )
                {
                    lifileupload.Attributes.Add("class", "current");
                }
            }
        }
    }
}
